package it.ap.sa.core.util;

import java.util.HashMap;
import java.util.Map;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.vividsolutions.jts.geom.Geometry;

/**
 * wrapper per produrre il geojson che ingloba l'oggetto da mettere nella
 * feature
 */
public class Feature {
	
	private String type = "Feature";
	private Geometry geometry;
	private String geometry_name;
	private Map<String, Object> properties = new HashMap<String, Object>();

	public void addProp(String key, Object value) {
		properties.put(key, value);
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Map<String, Object> getProperties() {
		return properties;
	}

	public void setProperties(Map<String, Object> properties) {
		this.properties = properties;
	}

	@JsonSerialize(using = GeometrySerializer.class)
	public Geometry getGeometry() {
		return geometry;
	}

	@JsonDeserialize(using = GeometryDeserializer.class)
	public void setGeometry(Geometry geometry) {
		this.geometry = geometry;
	}

	public String getGeometry_name() {
		return geometry_name;
	}

	public void setGeometry_name(String geometry_name) {
		this.geometry_name = geometry_name;
	}

}
